new Vue({
  el: '#app',
  data: {
    city: '',
    citys: [],
    value: '',
  },
  computed: {
    searchCitys() {
      return this.citys.filter(item => item.name.match(this.value))
    }
  },
   mounted () {
    this.city = $utils.query('city')
    this.main()
  },
  methods: {
    main() {
      $http.post('/member/api.users/get_province', {}).then(res => this.citys = res.data)
    },
    selectCity(e) {
      let el = $utils.getPathElement(e, 'van-cell')
      // 没有元素那就无效
      if(!el) { return }
      let id = el.dataset['index']
      location.href = "./index.html?city_id=" + id
    },
  }
})